package cn.lili.modules.system.client;


import cn.lili.modules.constant.ServiceConstant;
import cn.lili.modules.system.entity.dos.PackConfig;
import cn.lili.modules.system.entity.vo.PackConfigVO;
import cn.lili.modules.system.fallback.PackConfigFallback;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(path = "${server.servlet.context-path}", name = ServiceConstant.SYSTEM_SERVICE, contextId = "pack-config",fallback = PackConfigFallback.class)
public interface PackConfigClient {

    /**
     * 根据Id获取礼品配置
     * @param packId 礼品Id
     * @return 礼品配置
     */
    @GetMapping("/feign/getById")
    PackConfigVO getById(@RequestParam String packId);

    /**
     * 获取配置数据
     * @param field 字段
     * @param value 字段值
     * @return 配置数据
     */
    @GetMapping("/feign/getPackConfigByField")
    List<PackConfig> getPackConfigByField(@RequestParam String field,@RequestParam String value);


    @PostMapping("/feign/getPackConfigByPackIds")
    @ApiOperation("根据packids查询信息")
    List<PackConfig> getPackConfigByPackIds(@RequestBody List<String> packIds);
}
